<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>09下拉菜单</title>
    <link rel="stylesheet" href="./css/Element-ui.css" />
  </head>
  <body>
    <div id="app">
      <h1>{{info}}</h1>
      <el-dropdown @command="handleCommand">
        <span class="el-dropdown-link">
          下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item command="黄金糕">黄金糕</el-dropdown-item>
          <el-dropdown-item command="狮子头">狮子头</el-dropdown-item>
          <el-dropdown-item command="螺蛳粉">螺蛳粉</el-dropdown-item>
          <el-dropdown-item disabled command="双皮奶">双皮奶</el-dropdown-item>
          <el-dropdown-item divided command="蚵仔煎">蚵仔煎</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </body>
  <style>
    .el-dropdown-link {
      cursor: pointer;
      color: #409eff;
    }
    .el-icon-arrow-down {
      font-size: 12px;
    }
  </style>
  <script src="./js/vue.min.js"></script>
  <script src="./js/Element-ui.min.js"></script>
  <script>
    let v = new Vue({
      el: "#app",
      data: function () {
        return {
          info: "",
        };
      },
      methods: {
        handleCommand(command) {
          this.$message({
            message: "你点击了" + command,
            showClose: true,
          });
        },
      },
    });
  </script>
</html>
